package agrep4me;

class IStates extends States {
	private long me;

	IStates() {
		me = 0;
	}

	States empty() {
		return new IStates();
	}

	States copy() {
		IStates r = new IStates();
		r.me = me;
		return r;
	}

	void assign(States from) {
		IStates ifrom = (IStates) from;

		me = ifrom.me;
	}

	void clear() {
		me = 0;
	}

	void add(int i) {
		me |= 1L << i;
	}

	boolean mem(int i) {
		return (me & (1L << i)) != 0;
	}

	int getByte(int i) {
		return (int) ((me >>> (i * 8)) & 255);
	}

	void or(States s) {
		IStates is = (IStates) s;
		me |= is.me;
	}

	void and(States s) {
		IStates is = (IStates) s;
		me &= is.me;
	}

	void shift() {
		me <<= 1;
	}

	boolean equals(States s) {
		IStates is = (IStates) s;
		return me == is.me;
	}

}
